As far as I know, C# doesn’t allow using “ref” on “this” parameters in extension methods.
Another pitfall is that transform.position is a property. So, even if you manage to modify the value, you will only modify it’s copy, leaving the real value underneath the property unchanged.
Dmitry is right; ref and out don’t work with extension methods. How about
public static void AdjustPosition(this Transform transform, float? x = null, float? y = null, float? z = null) {
Vector3 position = transform.position;
transform.position = new Vector3(x ?? position.x, y ?? position.y, z ?? position.z);
}