I'm extremely lucky. My eldest DD went to schools where this kind of nonsense never came up. She's now in her mid-teens and it still hasn't come up. Probably because she's at a single-sex independent faith school.
It makes me rage that you have to be able to have money, either for private schools or to home-school to escape this ideology.
Anyway. I have talked to her about it and being very literal minded she thought it was a big load of horse shit and couldn't get her head around the science of it all. She couldn't understand how people could be born in the wrong bodies. She has never conformed to any kind of stereotype - hated dolls, princesses etc and now as a teen has zero interest in clothes, make-up, pop music or social media. Much to my relief.
She's also very kind, extremely kind in fact and very compassionate, so she would be exactly the type of girl who would either let her boundaries be crossed, or who in all honesty, would wet herself or give herself bladder problems by not going to the loo, because her reaction was that boys who think they are girls would give her the creeps.
Not learned hate, just an intuitive reaction. However we did then have a long chat about prejudice and the fact that people are suffering from a very debilitating mental condition. That's the way I would broach it with children. Explain to them that some people think x, but that actually it's not true and that we should always exercise compassion, not call people names but at the same time, especially girls, we should not be ashamed of, or afraid of our boundaries. We shouldn't have to get naked in front of men, unless we want to.