Actually, since your current injury and previous bouts of it have occurred at the bottom of a squat, it probably isn’t your one of your hip flexor muscles. Muscles are typically injured when they are either stretched excessively or when they are asked to contract against a load or in a position which they are not suited to deal with.
At the bottom of a squat, the hip flexors are actually on slack rather than on stretch and they are not contracting particularly vigorously since the hip flexion occurring as you descend into a squat simply occurs with gravity.
It sounds like it might involve your hip joint directly. At times, if an individual is very stiff in their glutes, hamstrings, or back side of the hip joint itself, the head of the femur (aka. thigh bone) can be rammed forward within the joint as the hip flexes. This can lead to impingement upon the structures along the front upper rim of the joint socket (i.e. joint capsule).
Occasionally, a ring of cartilage known as the labrum, which encircles the hip socket and blends into the joint capsule, can actually tear away from its attachment upon the front upper rim of the hip socket.
You might want to try to stretch your glutes and back side of the hip joint by simply getting on your hands and knees, flattening or even arching your low back inward slightly, and rocking your hips back over your feet without letting your back round up toward the ceiling.
You may have to mess around with the position of your legs by moving your knees apart, turning your legs so your feet are closer together, or performing some combination of the two to make the stretch pain-free. I can’t emphasize enough, though, DO NOT reproduce your symptoms with this. It could very likely make the condition worse.
You may also want to stretch your hamstrings although this may not be as big of a factor as your glutes and hip joint. There probably are some specific strength deficits that need addressed as well, but it is just possible to prescribe exercises for them without a proper exam.
Check some of the articles from Cressey and Robertson for ideas on stretching and mobility, but I wouldn’t recommend doing anything that reproduces the symptoms.
Hope this helps.
All the best.