okay, I'm by no means a legal expert but I will give you a step by step plan on how to handle this appropriately while causing the least amount of damage to all parties involved as possible.
I'd imagine romeo and juliet laws do not apply here, this is a dangerous line to balance, so get them together in one spot and let both of them know this and how serious this situation and its potential consequences are before someone else finds out and gets legal involved. if all goes well, they will both understand, (they will both probably be hurt by this but its better to get their feelings hurt a little rather than one person going to prison with a ruined reputation for life and the other probably developing a long term guilt complex or depression or some shit for being part of it). give them 48 hours (MAXIMUM! (ideally 12-24 hours should suffice)) to say their goodbyes, and hopefully they both leave each other alone after that.
I imagine this will have the same emotional impact of a breakup under any other traditional circumstance so be ready to talk with your friend, be supportive, make sure she is okay, if she has to rant or cry, let her. (aka don't be an idiot by trying to right-fight against her, that's quite possibly one of the quickest ways you can obliterate trust in a vulnerable moment (I feel like I have to say this because I know a lot of people who resort to this tactic as their opening move in other sensitive situations and it never ends well))
now all of that is assuming all goes well. things might not turn out this way, so here are some backup plans:
if lets say they keep in contact, they keep flirting, anything like that, document it, keep tabs on their conversations via screenshots or however else you can for a short period of time and use that as leverage to say "hey, I'm not kidding around here, this shit could get you both in a lot of trouble" once they see you have evidence (even if its not good evidence) it should scare them enough to take it seriously. that's backup 1
if she gets the hint and stops seeing him but he still pursues her, threaten legal action against him directly if this continues, this should be enough to scare him off if the previous steps haven't done so already. make it clear to him that if this happens again you WILL take this incident to the police. this is backup 2
if he STILL continues to be with her after that, talk to the police. hes 25, well past the point where being young and dumb isn't an excuse anymore. this is backup 3 if all else fails.
I want to state again I am NOT a legal expert, but this is what I would personally do in this situation. if you want better advice maybe talk to a lawyer or someone else like that, and it also wouldn't hurt to look up the laws for your state in particular around this if you haven't done so already.
oh, and one more thing I forgot to mention, but I think is worth noting. if you at any point feel that he is doing something to put her in immediate danger (threatening violence, sexual advances, etc.) ignore all previous steps and IMMEDIATELY inform the police. hopefully you will not have to use such measures right off the bat but it helps to be prepared just in case.
anyways, I wish you the best of luck