To connect a UPS and configure safe automatic shutdown on power loss, the knowledge base says to do this in Control Panel > Hardware & Power > UPS.
Local USB UPS
Important notes
If the NAS will act as a network UPS server
If another Synology NAS will use that UPS over the network
Sources used: [10], [11], [12], [13], [15]