Dynamical clustering in oscillator ensembles with time-dependent interactions