Ships, and many private yachts, carry the Automatic Identification System (AIS), which continuously transmits position data and static vessel information for the benefit of nearby ships, and in some cases also for shore-based traffic-control authorities.
MarineTraffic.org uses a worldwide network of volunteers to receive AIS transmissions from locations throughout the world and make this data available for display. You can look at a location or search for a specific vessel by name. AIS transmissions are fairly short-range, typically 15-60 miles dependent on antenna height, so there will be coverage gaps in the open ocean and in places where no volunteer receiver is nearby. Still, it looks like a significant % of the world’s coastlines and river mileage is covered.