How to predict position of object before transform.translate will apply?

I use transform translate to move object depending on the parent transform position and rotation and I need to check boundary position. So, what is the way to predict position of object before transform.position will apply. Because now I use this:

public void MoveZ(int dir)
    {
        Vector3 newPos;
        transform.Translate(Vector3.forward * dir * step * Time.deltaTime);
        newPos = transform.localPosition;
        transform.Translate(Vector3.forward * -dir * step * Time.deltaTime);
        if (newPos.z <= maxMoveZ && newPos.z >= minMoveZ) transform.Translate(Vector3.forward * dir * step * Time.deltaTime);
    }

I move object, then remember it position and move object back, after that I check limits. So if position is correct I again move object to those position.

You could just add the Vector3 of the position and test it that way. Something like this:

public void MoveZ(int dir)
     {
         Vector3 newPos = transform.position + (Vector3.forward * dir * step * Time.deltaTime);
         if (newPos.z <= maxMoveZ && newPos.z >= minMoveZ) transform.Translate(Vector3.forward * dir * step * Time.deltaTime);
     }