Transition to collective motion of spermatozoa in different confinements and at variable temperatures