The Ruler Of The Universe already asked the question
Douglas Adams hit upon this dilemma in The Hitchhiker's Guide To The Galaxy, Fit the Twelfth (shift-click to listen), later written in The Restaurant At The End Of The Universe, and even goes a bit further.
SPOILER ALERT: The "Ruler Of The Universe" turns out to be an old man living in a shack with a cat, and he is a perfect solipsist.
Ruler Of The Universe: Ah, this is a question about the past, is it?
Zarniwoop: Yes
Ruler Of The Universe: How can I tell that the past isn’t a fiction designed to account for the discrepancy between my immediate physical sensations and my state of mind?
So the Ruler Of The Universe takes your question even further and asks: How can we be sure that there even is a passage of time? Maybe the past is just an illusion? How can we know that it is not?
The answer is: we cannot know this. There is no way to escape the possibility that Hard Solipsism presents, namely that everything we feel and remember — including the passage of time — could be nothing but a huge illusion.
If we relax the solipsism a bit and assume that 1) the physical world is real and 2) the passage of time is real, then the answer becomes: the persistence of the material world.
The fact that matter and energy can exist without spontaneously poofing out into nothingness — instead they are persistent and does not change form spontaneously — is what enables it. If you are material, and your brain-state depends on theemerges from some of that material, then the persistence of the material world enablesmeans that your consciousness to be temporally contiguouswill also persist.