How to calculate the new boundaries of an object after transformation?
I have an object inside a layer, the initial boundaries of which are known, but I cannot get them directly (this is part of the image) . Object are described in the standard way in document coordinates - top, left, right, bottom. I need to perform a series of transformations of the entire layer and after that get the new coordinates of the object inside it (transformation in this case is only a change in scale, image rotation is not performed). I easily coped with move (x+dx) (y+dy), but I got stuck on the transformation with the center set manually (the coordinates of this point are known - x, y). It seems that I understand this combination of move + scale and a proportional change coordinates is required depending on their distance from the point x,y, but I cannot deduce the correct formula for calculating the new values of top, left, right, bottom. Can someone help me with this?

P.S. it is clear that we can copy an object to a new layer and perform its transformation with the same parameters as the main layer (this is how the script works at the moment), but I want to speed up the script and get rid of unnecessary transformations (that is, get coordinates by calculation )