You could use exactWorldBoundingBox to get the bounds, then calculate thecenter from that
With xform you can query and set the pivot so if you query first and then set X to the bounds' center X and Y & Z to the initial values you've got what you want.