a video would really help.
Off the top of my head, I am thinking that if you can good morning more than you squat, your hams/glutes/low back are not your weak link and your quads and upper back likely are.
Also it is probably a technical problem as well--get your shoulder blades together, pop your chest UP, not OUT, and force your elbows completely down. If you can maintain that in the hole, you will be staying up right.
Also not forcing your knees out hard enough can cause you to lean extensively as you push your hips back to try and make depth at the hip crease. It's weird to watch that happen. I don't think that's probably the case, my money is upper back is losing tightness and chest is coming down/elbows back.