Anisotropic magnetoelastic response in the magnetic Weyl semimetal Co3Sn2S2