From behaviour to the brain: representation learning and sensorimotor control