Constrained belief updates explain geometric structures in transformer representations