The impact of stratified immunity on the transmission dynamics of influenza