i had a similar problem earlier this year and finally when to a PT after 8 months of squatting with pain. He diagnosed me with a stain right hip ADDUCTOR(groin). The inflammation and muscle spasms was causing the pain. Treatment: massage therapy, muscle releases, stretches and pulls. A painful process!
Rehab: lying single leg lift, lying clam shells, crab walk with bands, foam roller, and foam ball then heat pack for 10mins. i also had a weak right abductor(outer hip) and weak left adductor (groin) which probably lead to the injury. i suggest going to a PT at least once for the massage therapy and muscles release, its really something can't do yourself. The rehab stuff you can do at home.