The Schengen Borders code contains several relevant dispositions. First, article 4 provides that
[…]
By way of derogation from paragraph 1, exceptions to the
obligation to cross external borders only at border crossing points
and during the fixed opening hours may be allowed:
(a) in connection with pleasure boating or coastal fishing;
[…]
Annex VI provides some details on how this is supposed to work in practice.
Pleasure boating
3.2.5. By way of derogation from Articles 4 and 7, persons on board a pleasure boat coming from or departing to a port situated in a Member State shall not be subject to border checks and may enter a port which is not a border crossing point.
However, according to the assessment of the risks of illegal immigration, and in particular where the coastline of a third country is located in the immediate vicinity of the territory of the Member State concerned, checks on those persons and/or a physical search of the pleasure boat shall be carried out.
3.2.6. By way of derogation from Article 4, a pleasure boat coming from a third country may, exceptionally, enter a port which is not a border crossing point. In that case, the persons on board shall notify the port authorities in order to be authorised to enter that port. The port authorities shall contact the authorities in the nearest port designated as a border crossing point in order to report the vessel's arrival. The declaration regarding passengers shall be made by lodging the list of persons on board with the port authorities. That list shall be made available to the border guards, at the latest upon arrival.
Likewise, if for reasons of force majeure the pleasure boat coming from a third country has to dock in a port other than a border crossing point, the port authorities shall contact the authorities in the nearest port designated as a border crossing point in order to report the vessel's presence.
3.2.7. During those checks, a document containing all the technical characteristics of the vessel and the names of the persons on board shall be handed in. A copy of that document shall be given to the authorities in the ports of entry and departure. As long as the vessel remains in the territorial waters of one of the Member States, a copy of that document shall be included amongst the ship's papers.
I have no first-hand experience with this and I am not a legal profesional so you should take all this with a grain of salt but my reading of these rules is that, unless you have called at a port outside of the Schengen area ("coming from a third country"), you don't have to do anything. But the Swedish authorities could still invoke the second paragraph to perform a border check anyway so be ready to provide all necessary info if required.
noonsite.com also provides a lot of information and in particular:
Yachts arriving from a Schengen country (i.e. all countries bordering the Baltic Sea with the exception of Russia) do not have to notify Customs on arrival in Sweden if there is nothing to declare […]
The Swedish Coastguard recommends that vessels, even though it is no longer strictly required, continue to submit details of crew and passengers in advance.
The same website also provides contact details for coast guard offices if you prefer to contact them directly to get official confirmation that you are indeed allowed to enter Sweden without formalities.