The so succinct answer could have come only from Azizam Jawaid.
God bless you!
With little science and technology during the times of the exalted prophet, any person with transvestism and feminine behavior was considered a 'Mukhannas' (Transgender or hermaphrodite).
24:31 And tell the believing women to lower their gaze, and guard their modesty. They should not show off their adornment beyond what may be decently and spontaneously apparent. Let them cover their chest area with their light covering. They should not let their attraction be apparent to any but their husbands or fathers or husbands’ fathers, or their sons or their husbands’ sons, or their brothers, or their brothers’ sons or sisters’ sons, or their women folk, or what their right hands possess, that is, the male attendants who lack all sexual desire, or children who have no carnal knowledge of women. And they should not strike their feet or swing their legs in walking so as to draw attention to their hidden beauty and ornament. O You who have chosen to be graced with belief! Turn all of you together to God so that you may be successful (in establishing a benevolent society). [33:59]