Without anymore description of your system (such as what the recycle function is), we can make a general statement that the second (booster) pump should be shutdown first. This shutdown order is probably just the reverse of your start-up procedure. The inline pump suction could be starved if you shutdown the pump in front first. Whether this suction starvation could actually happen or cause damage depends on the controls, including minimum flow controls and protections on the pump. Still, its a safe bet to shutdown the trailing pump first.
best wishes,
sshep