A ship is a vehicle, which would be considered an obect, as referenced in this question: What is an Object?
Whether or not the ship is considered a single object, or a massive collection of multiple objects would be at the discretion of your DM. However, I would rule it as a single object, because I like to keep things simple. (I rule this way in my own games as well, as there is already a lot to track, and I see no need to track each individual portion of a gargantuan sized vehicle.)
So with the way I rule in my games, if someone in your party can cast 9th level spells, which would require a level 17 spellcaster, or if you have a friendly NPC that can do it for you, the spell True Polymorph would work by using its Object into Creature option, as listed below:
Object into Creature. You can turn an object into any kind of
creature, as long as the creature's size is no larger than the
object's size and the creature's challenge rating is 9 or lower. The
creature is friendly to you and your companions. It acts on each of
your turns. You decide what action it takes and how it moves. The DM
has the creature's statistics and resolves all of its actions and
If the spell becomes permanent, you no longer control the creature. It might remain friendly to you, depending on how you have
From there, it's just a matter of traveling as far as you can within the 1 hour time frame and breaking concentration before the spell becomes permanent, OR you can allow it to become permanent and try to ensure this new creature is friendly to you so it can travel as a companion of sorts and just dispel it using Dispel Magic once you reach your target location.
If you need to get farther than simply walking will allow within that time frame, the 7th level spell Teleportation will work, as it only requires willing creatures, which the ship would be if it was polymorphed. The relevant portion of the spell is (emphasis mine):
This spell instantly transports you and up to eight willing creatures
of your choice that you can see within range, or a single object that
you can see within range, to a destination you select.
As DM for my groups campaign, this is how I would rule it, as it makes the most sense to me, and is logistically sound. The only issue with this would be having access to the spells mentioned, or your DM having other ideas for it.
And as always, the best option would be to talk to your DM to see what is actually feasible for your party in order to move the ship to the wanted destination.