And most, if not all, are not mentally ill by any current definition of that condition. In fact, it is based on physiological factors, to include the brain.
To me, a person is "mentally ill" as shown by an ingrained desire to waste money, in astounding ways. But they aren't defined as such.
Here, read and learn.
https://health.clevelandclinic.org/research-on-the-transgender-brain-what-you-should-know/