Coupling structural evolution and oxygen-redox electrochemistry in layered transition metal oxides