Well, I think each case is different, and some are related to transgenderism and some are not. The Elizabethan practice of men playing women's roles has much more to do with English concurrent cultural rules about what women were and were not allowed to do. It can be contrasted with the practice 40 or so years later of women playing "breeches" roles in plays and operas, where lower voiced women would play young men and other maculine roles. In Opera there is some confusion because it's unclear where some roles were for women or for Castrati (men who had been castrated as children to keep their singing voice high and "pure")
You could definitely argue that some of these practices have something to do with western European culture trying to figure out what to do with masculine women and feminine men, I just don't think you can argue that it's the whole purpose, or even the main purpose - just a... side purpose?
Someone like the Chevalier D'Eon is more likely to be related to the concept of intersex people, or people who have both male and female genitalia. They occasionally get lumped in with Trans people, but are really a separate group of people. There are some intersex people who later transition, though - XY or XX people whose genitalia were unclear at birth (either too large or too small of a phallic/clitoral structure) who later on transition to confirm their gender identity and have a phalloplasty or vaginoplasty to repair what doctors may have done to them at birth.