I can't recommend you a specific book, no, because I don't know one, but here is an interesting article - scrolling down to the heading 'Gender Dysphoria and Eleanor Rykener' may be of particular interest:
https://publicmedievalist.com/transgender-middle-ages/
There's also so much evidence and discussion out there around gender labels and attitudes to sex (sex as in gender, feel like I'm getting clunky with language) in tribes and non-western societies, both historical and contemporary. For example:
'The Navajo tribe from the south-west United States have a gender category called Nadleeh, which can refer to transgender people who have transitioned in one direction along the gender binary, gender fluid individuals and to those whose gender presentation is more masculine or feminine than their gender identity suggests.' from: https://blog.lboro.ac.uk/edi/gender-identity-in-indigenous-cultures/
It's a very, very real thing. I'm not against the protection of single sex spaces at all, but to me that's not the same thing as denying that trans people exist. Their history and identity shouldn't be scrubbed - it exists and children should be able to learn about it in an age appropriate way, like anything else. People in tribal societies today live as the opposite sex to what they were born, should we deny to children that that happens just because we want to defend single sex spaces? I don't think so. It's clearly more complex than that.
EDIT: @Crouton19 this was written as a reply to you, I don't know why it didn't post it as one!