How to update 2d-shader coordinates when camera moves
Edit: as I wrote all that is below, I just realized the question was explicitly about 2D shader...
You just missed to call
self.update_region(context, None)

from inside the callback, which is itself called at each drawing.
Though, as it is the calculation is not correct. You should use object world matrix (see the previous answer).

Previous answer (I don't delete it as that could be useful):
As you want to move during the operator, you are in 3d, use:
gpu.shader.from_builtin('3D_UNIFORM_COLOR')

instead of:
gpu.shader.from_builtin('2D_UNIFORM_COLOR')

Also, in this case, use POST_VIEW, as indicated in the documentation.

draw_type (str) – Usually POST_PIXEL for 2D drawing and POST_VIEW for
3D drawing. In some cases PRE_VIEW can be used. BACKDROP can be used
for backdrops in the node editor.

self._handle = bpy.types.SpaceView3D.draw_handler_add(draw_callback_px, args, 'WINDOW', 'POST_VIEW')

One shader is needed.
You can start from object axis and convert them in world space:
def draw_callback_px(self, context):

    obj = context.active_object
    mat = obj.matrix_world

    shader = gpu.shader.from_builtin('3D_UNIFORM_COLOR')
    shader.bind()

    bgl.glEnable(bgl.GL_BLEND)
    bgl.glLineWidth(2)

    origin = mat @ Vector((0, 0, 0)) #Convert coordinates in world space
    x = mat @ Vector((2,0,0))
    y = mat @ Vector((0,2,0))
    z = mat @ Vector((0,0,2))
    batch_X = batch_for_shader(shader, 'LINES', {&quot;pos&quot;: [origin, x]}, indices = ((0, 1),) )
    batch_Y = batch_for_shader(shader, 'LINES', {&quot;pos&quot;: [origin, y]}, indices = ((0, 1),) )
    batch_Z = batch_for_shader(shader, 'LINES', {&quot;pos&quot;: [origin, z]}, indices = ((0, 1),) )

    shader.uniform_float(&quot;color&quot;, (1, 0, 0, 0.2))
    batch_X.draw(shader)

    shader.uniform_float(&quot;color&quot;, (0, 1, 0, 0.2))
    batch_Y.draw(shader)

    shader.uniform_float(&quot;color&quot;, (0, 0, 1, 0.2))
    batch_Z.draw(shader)

    # restore opengl defaults
    bgl.glLineWidth(1)
    bgl.glDisable(bgl.GL_BLEND)