calm down
first of all don't call it masturbation. all kids at this age age like to discover their bodies , they like to touch their private parts especially after they are potty trained.
the most important thing is not to yell at him and tell him to stop in anyway. if you make him stop, he will tend to hide and touch him self.
once you see him doing it redirect his attention to something else such as give hime something , show him something , hug him or start tickling him. just don't let him feel that this is a big deal that makes him focus even more on doing it,
it is normal for all kids not only your son.
p.s my son was like that when he was 3, now he is 4 and completely forgot it.