I never have locked my knees when squatting, always kept them slightly bent, but is it better to push the hip forward and squeeze the butt when you come up or just stop at the top?
You do want to squeeze your glutes coming up, but you don't want to push the pelvis forward, which would give you an anterior pelvic tilt --- a presenter at a fitness workshop I attended called it, "the Elvis Pelvis"
To find 'neutral spine' or neutral pelvis, picture your pelvis is a bucket of water... anterior pelvic tilt (I may have these terms reversed, but the concept is the same) is when your tailbone points up & your butt sticks out back with lower back arched... the water would spill out the front of your belly.
Tuck the pelvis under brining tailbone forward & water spills out your lower back. Neutral will be between these too extremes.
Neutral spine is important to keep in mind when doing ab crunches, but it's good to maintain all the time! It's good posture & protects the spine from stress.