To clarify, I think (or hope) this is what you're trying to say; being transgender is not a mental illness. The effects of either pretending to be cisgendered, or attempting to live life as the gender you identify can definitely lead to mental illnesses (depression, low self-worth, anxiety, etc.). I can't think of one trans person in an unaccepting household who didn't develop a few bad coping mechanism for their gender dysphoria. Luck decides if that coping mechanism leaves you scared for life (physically, mentally, socially), or if you're able to eventually unlearn it after you've gotten away from your toxic childhood environment.