thanks for posting your query
You get pain in left side of butt off & on.
It might be due to some muscular strain.
It has no any direct connection with masturbation
but it may be due to your positioning during masturbation.
So if the pain persists, you have to visit an orthopaedic surgeon
for clinical exam.