When can I transfer goods from a boat to a warehouse? Only at home port? On any land spaces? On land spaces that have markets?
Before or after sailing, "You may also load or unload goods from your ships’ holds into or out of warehouses you control in that region."
Note that at the beginning of the game, the only warehouse you control will be in your province, so your ship will have to be in your province region to unload.
You can rearrange goods between your ships before/after sailing if they are together at any (land) region.