AbstractBifurcation theory has been highly popular in the analysis of mathematical models. However, stability and bifurcation analyses are only for asymptotic dynamics while applied scientists care more about transient dynamics. In this paper, we first rigorously analyze Holling–Tanner model with generalist predators who have alternative food sources, and then discuss transient dynamics via a changing environment. For a constant environment, we provide a complete bifurcation analysis with high codimension. It is shown that the highest codimension of a nilpotent cusp is 3, and the model can undergo degenerate Bogdanov–Takens bifurcation of codimension 3. Moreover, by using resultant elimination to solve the semialgebraic varieties of Lyapunov coefficients, we show that a center‐type equilibrium is a weak focus with order at most 2, and the model can exhibit Hopf bifurcation of codimension 2. Our results indicate that generalist predators can cause not only richer dynamics and bifurcations, but also the extinction of prey for some positive initial densities. Numerical simulations, including the coexistence of a limit cycle and a homoclinic cycle, tristability, two limit cycles, are presented to illustrate the theoretical results. In a changing environment, the populations start along one stable state but can track unstable states or oscillations when the system crosses a bifurcation point, and then tend to another stable state or oscillations. This tracking on transient dynamics predicts regime shifts under environmental changes. When environmental conditions vary, the populations can track unstable states in the constant environment. The rate of environmental change determines how long the system tracks an unstable state although finally the solution under environmental change is attracted to a stable steady state or limit cycle. Finally, we focus on a periodic environment and find that the populations converge to a periodic solution or an invariant torus depending on both the initial environmental capacity and the amplitude of periodic fluctuation.