Since the episodes are relatively infrequent, there does not seem to be reason for alarm. I wonder if your son is experiencing some muscle cramp, though the location is a bit unusual for this. Have you consulted with a pediatric orthopedist? It would be sensible, for the sake of covering the bases, so to speak. The frequency indicates this behavior is not rooted in a psychological explanation.