I would either wake up slightly sweaty or wake up and start to feel waves of warmth thru my body. I made the connection that it usually happened if I over exerted myself physically earlier that day. So it's either a low blood Sugar thing and adreneline is coming to save the day or its low cortisol and adreneline trying to compensate.
I also used to notice hot flashes week before and after my period. I thought it was perimenopause and decling hormone levels. But the hot flashes weren't random. They were usually in response to a stressor like my boss acting confrontational, eating, or general stress.