Nucleation under time-dependent supersaturation