Yes, for the G540 it has all four drivers in it that you need. That's one of the many reasons it is so popular. Slaving motors has become a popular way to minimize racking issues on machines with wider gantries.
Most of us assign the X and A axis letters for slaving the two motors together. You could also use B or C. Note that one of the two motors needs to be configured in Mach3 to run the opposite direction so that both ends of the gantry travel in the same direction. The motor cables will be wired the same way.
CarveOne
CarveOne
http://www.carveonecncwoodcraft.com