I’m not an expert whatsoever but I have done a fair bit of international travel and resided overseas for multiple years.
That experience has lead me to believe that unlike many countries the US government doesn’t care to track you leaving the country. They may know incidentally due to other processes such as airport/airplane security checks but those are performed by TSA; not the CBP. Both agencies fall under DHS but perform distinct functions.
When leaving the US by air you will go through security checks, but when arriving you come through customs and immigration.
All that is to say I think when traveling by private boat your main concern will be with entry into Mexico; not departing from the US.
I had long ago fantasized about traveling the world by sailboat and often wondered how immigration via seaport would work but never pursued an answer. Your question motivated me to do so.
This is what I found regarding entering Mexico via seaport from a private boat:
STEP 1: Submit passport of captain and vessel documentation along with $332 fee
STEP 2: Complete form with documentation of passengers and crew
STEP 3: Submit completed form from STEP 2 along with receipt from STEP 1
STEP 4: Await confirmation of approval from STEP 3 and receive entry authorization.
STEP 5: There is no step 5! Enjoy a margarita or paloma on the beach!
https://consulmex.sre.gob.mx/vancouver/images/pdf/boat.pdf