Boyfriends depression/anxiety

So I have a boyfriend and he's had a rough past, he's on a way better path now but from time to time I think he gets panic attacs and nightmares and co. But I think he's had it for that long that he's learnt to control his attacs (so for example sometimes we be chilling and he just stares off into space sometimes his breathing changes or he starts rapping or having muscular spasms kinda) and I have no clue what to do so I kinda just hug him and just let him know I'm there, anyone have any advice? Or someone whose got the same thing 💕 please help me out