How to script a gizmo that would be transformable(move, rotate, scale) independantly from the object it would originate at?
Gizmos require a target to act upon.

Manipulating the gizmo will act upon either:


Property
Operator
Callback


These are set by calling one of the following methods:

target_set_prop(target, data, property, index=-1)

target_set_operator(operator, index=0)

target_set_handler(target, get, set, range=None)

The second of these return an Operator Properties object which you can then set.  Still researching this and need to run some tests but I believe that the second one is what you are looking for.  Please see the documentation for these methods

See the gizmo_operator_target.py template for an example using the transform operator.

See the gizmo_operator.py template for an example that performs a more complex operation using the callback method.

Callbacks made easy

It's quite difficult to see what's going on in the template example so I have prepared a simpler version:

def setup(self, context):

    arrow = self.gizmos.new("GIZMO_GT_arrow_3d")

    def move_get_x():
        return context.object.location.x

    def move_set_x(value):
        context.object.location.x = value

    arrow.target_set_handler("offset", get=move_get_x, set=move_set_x)

    arrow.matrix_basis = context.object.matrix_world.normalized()

    self.x_gizmo = arrow


def refresh(self, context):
    self.x_gizmo.matrix_basis = context.object.matrix_world.normalized()


In order to manipulate a gizmo independently you will have to look at the matrix_basis property.

Simply commenting out the last line in the refresh method will leave the gizmo where it first instantiated:

#self.x_gizmo.matrix_basis = context.object.matrix_world.normalized()

If you want to keep the gizmo with the object then you need to update matrix_basis accordingly.

Subclass Gizmo

Another option is to subclass gizmo, unfortunately I haven't had time to write up an example of this but it is another avenue to explore.

You might also want to look at using the matrix_offset to retrieve information about the change.

If this still isn't quite what you're looking for then you can consider using an empty and attach the gizmp to that instead.

You might also want to look at this question.