Learning time-scales in two-layers neural networks