Buddhism posits that there is no permanent self. Hinduism posits that there is only a permanent self.
My take on this is that the self needs the illusion in order to perceive itself, or rather, the self-perception of the permanent self itself is what causes the illusion.
Because of that, when you detach from the illusion, then you are without self-perception, and you reach a state of not knowing the self.
While Buddhism says “there is no permanent self”, I say “no perception is the original state of the self”. That is, while Buddha says “anatta”, I say “nasanna-atta” (non-perceiving self)
There is the theory that says: “Where there is perception, there is a self. Without perception, there is no self.” I totally agree with this, which is why cessation of perceptions cause the cessation of self. But this is not attained even in deep sleep, because the body is held because the self is existent as it is perceiving through other bodies.
What is attainable is Nirvana, as you stop perceiving the illusion with your mind, and hence the self stops perceiving itself through your body too. But since the self does exist, this cycle will continue, as the body is awakened by influences of the other aspects through which the self perceives.