Possibly. What are the ratings of the xfrmr to be swapped? Will the ratings of the replacement xfrmr might the needs? If so, then yes.
Assuming both xfrmrs output the same secondary voltage (primary will be the same) you just have to make sure the replacement xfrmr is the same as, or has a greater VA rating. You can't replace a 100VA xrfmr with a 50VA xfrmr, but you can replace a 100VA with 200VA xfrmr for example (with the same primary/secondary voltages).