I had the same problem recently but I am no doc so I would get it double checked .I was using my hip flexors to stabilize instead of my smaller glute muscles also not pushing my knees out enough when squating wasnt helping either and although I stretched my hip flexors a lot I never got a stretch in my pelvis it was normally lower down my thigh so was basically bypassing the stretch and not actually opening them up.
So what really helped me was
Hip flexor stretch on one knee one foot and tucking my pelvis under hold min 2 minutes .
Also doing the exercise clamshells focous on getting the glutes firing then start using a dyna band .
But thats just what I did might be different for you