When the posterior chain is weak, the body will default to the strongest position which in your case seems to be pushing the knees forward trying to use the quads to assist the posterior chain. The prime movers in the squat are the glutes and secondary the adductors. The quads can be thought of as tertiary movers. Don’t forget we’re talking about the low bar squat here.
When the hips stay back, the glutes are doing most of the work, however they can only function when the midsection, spinal erectors, and hip flexors (help maintain arch), can properly brace the spine.
As for midsection work (I hate the term “core”), I like Roman Chair situps, inclined situps, spreadeagled situps on the floor, side bends, suitcase partials in the rack, and leg raises. Also, one thing that always worked for me is just simply supporting heavy weight and trying to be as still as possible for 10-30 seconds with heavy weight (up to 100 lbs over max).