Magnetoelasticity and the spin rotation transition in cobalt