How do i reset the scale to 1 but convert back the translation into the same space - so the translation is not identity, but the scale is.
Wait a moment … do you want
(a) to manipulate the transform matrix so that its scaling part is identity, or else
(b) to rescale the object's mesh in place, so it isn't moved further but has the original size?
Before I assumed you meant (a), but now your 2nd post let me think that you may alter the object's mesh directly, as for a static mesh, and want to undo part of it.
If (a) is the case then you simply need to set the transform.m[0] and transform.m[4] to 1.
If (b) is the case then you need to transfer the object temporarily into the space where the center of scaling is at the space's origin, because scaling ever extrudes from (0,0). Because the original center of scaling was at (0,0) before the translation has happened, the math would look like (following your non-matrix formulas above)
newX = ( posX - tx ) / sx + tx;
newY = ( posY - ty ) / sy + ty;
If you are used to use column vectors, then the above transform is equivalent to
p' := T * S-1 * T-1 * p
where S denotes the decomposed scaling and T the decomposed translation matrix.