I did some exploratory surgery to find out where that piece is located, I suspected one of the legs joints so I started it there and found it:





The spring pushes the tip of that round tab into a hole on the side of the cockpit lower body so that the hip is kept in place in robot mode.

I hope this helps