asking a friend for their number

Amber • 17 years old. I've been with my fiancé for 2 years and 7 months😊
Ok so, this may sound like a weird problem, but, I have this friend who I met this year and he's a senior which means he's gonna leave like, next week. I'm a junior. And he's really cool, I want to stay in touch with him after he graduates, but I don't know how to ask him without sounding like I'm flirting or having it sound weird. I have very bad social anxiety. I'm always afraid to mess up and say something wrong. I was wondering if anyone has any advice?