Adaptive stress and the development of learning capabilities