Even after perfecting your setup in terms of foot placement, core bracing, and bar positioning, you may still have an ugly squat. To enhance the squat pattern you'll need to use the core, glutes, and lateral hamstring groups to create pre-tension and gain torque and stability before descending into the squat.
Pre-tension means what it sounds like: creating tension before some other event takes place – in this case, the lift. Placing a light mini-band around the knees can improve your squat instantaneously and become a teaching tool that'll get you into optimized positions and back to band-free squatting.
The band will help you recruit secondary actions of the gluteal and hamstring groups for enhanced stability. The whole gluteal group extends the hips and externally rotates and abducts the hips. It also slightly posteriorly tilts the pelvis. This is the optimal position to create stability.
Place the band just above the knees to get it in more direct contact with the femur (upper leg bone), which we're trying to gain the spiraling position from. Use this as your reminder to get your knees to drive the band apart and also to externally rotate the hips against the band.
First tense the core, glutes, and hamstrings against the feedback that the band provides, then smoothly drive your hips down and back into the squat.