One can differentiate between the two by the person's behavior.
..we know it by its fruits. An idiot, when he goes to sleep, comes out
of sleep an idiot or even worse. But another man goes into the state
of meditation, and when he comes out he is a philosopher, a sage, a
great man. That shows the difference between these two states.
The Complete Works of ...
In the middle stage of Yogic practice (a stage which is known as the Ghata Avastha), an adept Yogi obtains various Siddhis (perfections). Among which floating in the air and becoming invisible are there.
Quoting from Shiva Samhita:
When the Yogi, though remaining in Padmasana, can rise in the air and leave the ground, then know that he has gained Vayu-...