I had a similar problem in the past when squatting where my right side would always raise faster than my left side. My right side erector and lats always felt more sore. I thought that maybe if I tighten my left side more and raise the left side faster, it would fix the problem. That only worked until the weight got heavy when I went back to my strongest position where the right side went up faster and my left knee would move out a bit more than my right side.
It wasn't until I had a technique overhaul where I learned to get everything tight that the problem went away. I squatted in a similar manner where I hyperextended my back and relied on my erectors and hamstrings to drive out of the hole. To develop the stability to control the bar and your body, you need to strengthen your abs, hips, shoulders and get them involved in the lift.
The first thing you need to learn is to brace your abs. Do a lot of work to build your ab strength so that it helps to resist hyperextension when you squat. It will take awhile for your ab strength to catch up so expect for this to take some time. It could take a couple months or longer.
The second thing you need to build is your hip strength. You need to learn to fire you gluteus medius and hip flexors together and you won't be able to do this well unless you know how to brace your abs. The hip strength comes from learning to use your erectors, abs, gluteus medius, hip flexors and gluteus maximus together throughout the entire lift.
The third thing is to build your shoulder strength so you can pull your shoulder blades down. The general advice is to pull the elbows down with the lats but that won't get you very tight if you don't anchor your shoulder blades down to your spine and rib cage by pulling them down. Do a lot of pull down work where you focus on pulling your shoulder blades down while keeping your chest up.
I can't put a timeline on this since it depends on how much time and effort you're willing to commit to just these things and whether you're doing it effectively. I have been able to help a couple friends develop technique focusing on the above with the goblet squat, seated good mornings and some isolation work. It took a couple months for them to develop the consistency and I still remind them from time to time to keep tight but overall it's a huge improvement.