Well the simple rule is it’s always her fault if she cums without permission. She hasn’t told you to stop when she should have, and then hasn’t controlled herself and stopped it.
So firstly, it always gets ruined. As soon as she goes over and it’s clear she has, you stop all stimulation and make sure she doesn’t try to touch herself to finish it off. Every single unauthorised orgasm is ruined, no exceptions. (This should go for when she’s edging herself too).
Now it may be she needs to get better at communicating and you need to learn her body signals better too. So you can get her to use a number system to say how close she is, ten being orgasm, and carefully watch and observe just how she moves and acts and reacts to what you do as she gets closer to closer.
In some positions you can go further and if she starts to go over you can give her pussy a nice hard smack and that will actually stop the orgasm completely – a bit of an emergency rescue technique. But that doesn’t work for everyone, fun trying though!
And then beyond that, you know best, or you can discuss and decide, what punishment fits her cumming without permission. Is it a spanking (or does she actually love that so it’s an incentive!), is it no touch, or a crotch rope or plugging or stuffing. Try different things and see what works best!
Also, ruins often get worse the more she has them, so do some on purpose. I find being fucked with fingers, cock or toys which are pulled out just as she goes over tend to make it far more intense, so have fun with that. And you can sequence them too, start with a clit ruin, follow with a vaginally focused one and then both together. She’ll be a blubbering mess by the end (and left nearly as horny as she started, which is the obvious benefit) and will be far more active in helping you stopping her having those naughty unauthorised cums.