While on the ship, get a list of shore excursions and see what interests you. When you go ashore, you can book directly at a great savings. Only problem might be, that if you set it up yourself, and something breaks down, or you get detained for whatever reason, the ship will not wait for you.
If you book on the ship, then you will pay more, but the ship will wait for your tour to return if anything happens.
The tours that the ship uses are usually the better operators, where if you book it yourself, you are at risk of possibly not getting what you expected.