Evolution of vertical and oblique transmission under fluctuating selection