The transfer of your HSA to your spouse is not considered a taxable transfer. After the transfer, the former spouse is treated as the HSA account holder. You or your former spouse must request the transfer to the spouse’s name and perform other actions required by financial institution or the law. All HSA rules regarding continued tax-free status, contributions and distributions will still apply.
Source: "Publication 969 (2018), Health Savings Accounts and Other Tax-Favored Health Plans.”