A widely-applicable method for solving problems like these is to transform to a more convenient coordinate system, apply a simpler operation, then translate back.
In this case, the invariant line is parallel to the $y$-axis. Presumably you know or can work out how to perform a shear parallel to the $y$-axis that leaves the $y$-axis fixed. So, translate $x$ by $-2$ to put this line on the $y$-axis, perform the shear, then translate back.