First of all I have a question about the wording of the sentence. The word masturbation seems a bit of an exaggeration. If your son is actually coming to completion then a doctor must be consulted.
If he is just playing with himself, as my three year old is, that is age appropriate. I don't say that to say it is excusable, just nothing to worry about. When we see him playing with himself we simply ask him if he needs to go to the bathroom. He says no and removes his hand. When he is in the bath and touches himself we tell him that a penis is a part of the body, is it private, and should only be touched or played with in private.
He is slowly getting the message, although he will tell us it is fun, or it tickles, or it feels good. I understand where he is coming from and I try to simply keep it low key, know he will grow out of it if we keep encouraging him to play only in private.
Oh, I just notices you were talking about your daughter, but I think the same concept applies. Sorry.