Online Learning and Control of Dynamical Systems from Sensory Input