Predicting transient amplification in perturbed ecological systems