The intergalactic medium transmission towards z ≳ 4 galaxies with VANDELS and the impact of dust attenuation