The answer is to install a large(r) standpipe.
Some older homes have a 1 1/2" or 2" galvanized standpipe (with trap at the bottom) inside of the wall. Others have the trap on the outside of the wall, with a traditional thin-walled galvanized standpipe running up the wall from the trap. Both are undersized for newer washers with pump outputs that exceed their capacity.
For outside the wall traps, it is relatively simple to build a larger diameter standpipe out of ABS or PVC pipe, adapting it to fit into the existing (or better, newly replaced) trap.
For inside the wall setups it is a bit more invasive but still DIY feasible to open the wall and remove the original galvanized standpipe, plumb the trap to the outside of the wall, and build a larger diameter standpipe as outlined above.
The larger standpipe gives more holding capacity to allow your old crusty occluded drain system time to drain down prior to overflow.
I have "fixed" several issues like yours with 3" ABS standpipes. Another option is the old laundry tub trick.