Inverse Optimal Control of a Class of Nonlinear Multi-Agent Systems with Applications to Ship Slew Rate Control