Some interesting advice for parents taken from the Internet.

What Parents Can Do
*Ignore it.
Masturbation is, after all, a normal behavior for most children.
Parents can best handle it by treating it matter-of-factly. Parents
shouldn't try to get their children to stop masturbating by
punishing, threatening or scolding. If they do, they run the risk
of giving their children the idea that their genitals are bad
and/or dirty.
*Remain calm.
Parents should try not to overreact. They should also keep in mind
that no physical harm will come to their children as a result of
masturbation. If parents overreact, they may put fear into their
children about their bodies.
*Don't be surprised.
Masturbation among young children is very common, and quite
normal.
When Children Masturbate in Public Places
Masturbation is something that should be done in private. Most
young children, however, don't know the difference between public
and private behaviors. In these cases, children must be taught.
Parents should treat public masturbation as they would any other
behavior that is not acceptable in public places, for example, nose
picking. Here are some specific things that can be done to minimize
masturbation in public places.
*Explain. If parents discover their children masturbating in a
public place, they should tell their children that is something
that should be done only in private, for example, in the children's
bedroom or the bathroom. Parents should use words like, "It's all
right to do that in the bathroom or the bedroom, but not in the
grocery store or when other people are around." Parents should try
not to criticize, nag, or punish their children. They should treat
the behavior matter-of-factly.
*Offer alternatives. Parents should provide their children with
something else to do with their hands while they are in public.
They could also try to distract their children from masturbating by
suggesting some other activity.
*Be consistent. If children, for example, masturbate while they are
at day care, parents should work out a solution with their
children's day care provider. It is important that the behavior be
treated in the same way by parents and by other care
providers.