Effects of population density and environmental conditions on life-history prevalence in a migratory fish