One good definition is when the person in question firmly believes something that is manifestly untrue, and especially if that delusion is not merely imaginary but also produces suffering, misery and social dysfunction. Then it's pathological and toxic, not merely fanciful.
Thinking you're a woman when you're a man, or thinking you're a man when you're a woman fits that bill perfectly. It's a severing of the grasp on basic reality, with consequent misery, maladjustment and destruction of social function. It means a life of sadness and hopeless fighting against reality.
Take Bruce Jenner. If we are honest, is there one single person in the whole world who actually believes he's a woman? Never mind the nonsense: is there really any doubt he's anything more than a mentally ill man?
Of course not. You know it, I know it, and even those fools who parrot the rot about him "always having been a woman" know it. But unlike you and me, they are willing to sacrifice Bruce on the altar of their pose of "tolerance," so that they can self-worship. None of it has even a modicum to do with truth, honesty, or what's good for Bruce Jenner.