If you see him again "randomly" you should text him and tell him to stop. Do not make conversation. Tell him that you think he is stalking you and that if that behavior doesn't stop immediately you will take action, i.e. ask for police intervention.
Don't know where you live but here I can go to the police and explain the situation, you don't need to get into the exact details, it's not important. But here they would contact him and ask for an explanation of his behavior.
Usually that gets them running. These ass holes always hide from real authority.
This is what I would do.
Be safe,