Hi KAV, you may be able to temporarily relieve the pain with stretches or foam rolling but you really need to investigate why this is occurring. There are plenty of YouTube videos on stretching and foam rolling exercises but without knowing what is actually causing the problem you risk making the pain worse if you choose the wrong exercise. Stretching and foam rolling may help release tight muscles but will not help strengthen any weak muscles that could be causing your pain.
It could be an imbalance in your movement patterns caused by a mixture of tight and weak muscles, that has become a habit and feels normal, so you aren't even aware of it. These movement imbalances usually start causing pain when you lift heavier weights and if they aren't addressed they can cause serious injury. The first thing I would suggest is to check your form when doing the exercises. You may be rolling through the ankle or knee or twisting slightly through the hips. You could try filming yourself doing the exercises and see if you spot anything obvious. Otherwise you could have someone else check your form.
I also recommend you check out Tom Morrison's YouTube channel, as he has a lot of good information on correcting imbalances.
Hope this helps.