Efforts in Republican-led states to write definitions of male and female into law are leading to outcry that the measures deny transgender people legal recognition