Emergence of slow collective oscillations in neural networks with spike-timing dependent plasticity