Transgender is a very broad and not a very well defined term, but a much more well defined term for which people most often mean is feeling a persistent, consistent and insistent need for transsexualism since early as memory appeared in mind (most often referred to as gender dysphoria) which as of itself is not a mental illness and generally isn't caused by a mental illness as I will further explain:
Gender dysphoria can be caused by various intersexualism conditions by which a human is somewhere between a female and a male at least by brain anatomy and physiology and of course, that effects developmental psychology in the course of life (hence feeling, in a sense, somewhere between a female-woman and a male-man) but with a case-dependent proper treatment, if at all needed, a person can live functioning, constructing and possibly very happy life and do lots of good in this world.
Further, gender dysphoria is a "mental condition" in the senses that:
- It requires tremendous amounts of time and energy to figure out how to deal with the dissonance between gender sensation or gender identity and body appearance
- It requires tremendous amounts of time and energy to chose how to deal with it and doing so in practice, which as of 2020 is going through a most likely (yet not necessary) vast change in body appearance, apparel, cosmetics, bureaucracy and so forth including taking hormonal treatment (and for some trans persons - different types of surgery)
- This is probably hardest (no pun intended): It requires dealing with ignorance and transphobia and often suffer from drug abuse, harsh violence and so forth (with many transgenders being, sadly, sexually abused, murdered or got suicide)
It should be noted that indeed there are some non general / extra ordinary / extremely rare cases in which some mental illness cause someone (as part of a delusional or dissociative phase) a gender dysphoria so she or he might actually transition based on wrong diagnosis in the end but these sad cases (which are barely seriously researched) will most likely end in detransition (permanent type) and are different than generally all cases of transsexualism in etiology.
Yet, these rare cases should be taken very seriously as people lost body parts and/or functions (such as gonads, genitals and female breast or hair or got a way softer voice and so forth)
or got extra body parts and/or functions (such as female breast or more permanent hair or deeper voice and so forth) for which they are probably regret to this day.
I note that these
should-end-in-permanent-detransition cases are neither the majority, nor the most of cases of gender dysphoria, per what I understand and explained.
Update (comment notes that might get deleted):
One has to differentiate between a mental state (or "condition"), a mental disorder (not being in order with the common mentality which isn't necessarily bad) and a mental illness (which at least harms or by proper consistent evidence, can consistently harm others and/or a person itself seriously);
As I have explained, transsexualism is a technical process that surly isn't a mental illness or disorder and gender dysphoria that usually cause it, generally isn't caused by a mental illness or disorder.
By my opinion, supporting both those who really need transsexualism and the tiny minority of detransitioners (permanent or not) and finding ways to prevent the extremely rare cases of
should-end-in-detransition transsexualism (especially permanent type) is one way to make this world better.