Braxton hicks. Usually starts at 2nd to 3rd trimester. Anytime, anyday. Will not affect baby but it's an uncomfortable feeling. Can happen during intimate moments too. Normally will come and go a few secs. Totally normal. Not sure about masturbation though.