That’s good. I’m glad he was happy!It is often ghastly and fascinating to watch them yawn - when they make big yawns it looks like they are turning their whole mouth inside out
Your rat was probably sleeping when you started, and this results in them yawning, much the same as humans - we yawn when we come out from shallow breathing phases like sleep.
The has been some association with yawning behaviour and environment - rats in a stressed state will avoid yawning. I guess that it means your rat is happy and comfortable around you, and you woke him up and he was not bothered by that or by you and felt it was safe to yawn and chill out with you.