Chances this is related to a nerve which may be getting pinched at certain activities that you are doing when this occurs. The nerve can be anywhere from your spine to your leg down to your foot that is causing this.
You need to see your doctor for further evaluation. Generally a NCV and/or EMG test can indicate where this is occurring for proper treatment.
Hope this helps, If you need anything else please feel free to ask. If you found this helpful don’t forget to click the *accept* button!