4D vectors and Matrices are used for 3D Affine Transformations.
You can use the equivalent 2D Affine Transformation which is a 3D vector with the z-value to 1 (and then discarded):
vec3 transformed3d = transformMat3 * vec3(x, y, 1.0);
vec2 transformed2d(transformed3d.x, transformed3d.y);
Or alternatively, you can use can use the aforementioned 3D Affine Transformation with a 4D vector and Matrix by setting the z-value to zero and the w-value to 1 for homogeneous coordinates and then using the x and y values directly in a parallel projection:
vec4 transformed4d = transformMat4 * vec3(x, y, 0.0, 1.0);
vec2 transformed2d(transformed4d.x, transformed4d.y);