I don't know these hubs specifically, but usually all you need is an XD freehub - take off the old HG freehub and replace it with your new XD one. And when I say 'all' I mean that you may need an XD-specific endcap too.
Typically, swapping freehubs doesn't require any tools even. The freehub needs to be specific to you hub model though, so you may need to ask Yuan An about getting a replacement.
Having said that, there is a remote chance that the Goldix freehubs may work as the Goldix 310 hub is said to look very similar to the Yuan An M14 hubs (see pictures). Here is a link to the Goldix hubs if you want to gamble.
https://www.aliexpress.us/item/3256806545992017.html (I'm guessing you want the XD THRU for MTB option (available both in black and silver))