On-board ST-Link Firmware
There's no officially supported way of doing this. ST does not make the ST-Link firmware available for public use.

Unless you're designing a development board, there's no reason to use an onboard ST-Link anyway. If you want to allow the user to update the firmware on their device, consider implementing a USB bootloader (or using one that's already present on the device, if applicable).