First step I'd suggest is to see whether or not simple technique correction may help you.
To this end, at the top of the squat picture your lumbar spine in its normal lordotic curve, if anything push your bum back to exaggerate it a little more. Now what you have to do is make sure that feeling/image in your lumbar spine is maintained throughout the squat. At the bottom simple keys/triggers that may help from a technique point are squeezing your but, and driving from the legs first (not the back).
If technique correction doesn't work, then its time to start looking at musculoskeletal causation. BBB has touched on the big areas of the hip, and yes, with your knees flaring it does sound like a hip related issue.
Check out your single leg balance (eyes open and closed). Are there asymmetries there? If so, I would bet that you are also slightly favoring your GOOD side on the descent in the squat to compensate for poor balance on the bad side. If balance is an issue, incorporate balance work (lots of it that works, duradiscs, wobble boards, single leg squats, lunges, split squats etc etc etc).
Check out hip flexibility. If there are issues, address as identified. Any problems down the IT band and up around glut med, stretching + foam roller work does wonders.
Side bridge endurance (side plank). Do this on both sides. Normal range is between 40-80 seconds. If you get to 2 minutes, stop, you're doing fine. If there are issues, (asymmetry or below normal range), then you should look to work on, and yes, I'm going to say it, "core strengthening".
If you find specific issues around the hip I second BBB. Cable based work for either side lying hip abduction, or standing adduction, are very effective training tools.
And lastly, I strongly encourage DB step ups (at least 40cm box) as a strengthening/balance exercise. Great for the gluteals, as well as a nice complement exercise for the quads/hams/calves.
As a matter of fact, I strongly encourage all of you buggers to be incorporating weighted DB step ups into your routines. Great fucking exercise that can help you stay on top of things in regards of balance, hip function, muscle timing patterns, movement patterns, etc etc etc.