Less and more IGM-transmitted galaxies from z ∼ 2.7 to z ∼ 6 from VANDELS and VUDS