A general scheme for the construction of dynamical systems able to learn generation of the desired kinds of dynamics through adjustment of their internal structure is proposed. The scheme involves intrinsic time-delayed feedback to steer the dynamics towards the target performance. As an example, a system of coupled phase oscillators, which can, by changing the weights of connections between its elements, evolve to a dynamical state with the prescribed (low or high) synchronization level, is considered and investigated.