At the moment there is no way to setup Dynamic DNS for most generic routers. There are 2 options on how you can deal with this.
DD-WRT is Linux-based firmware for wireless routers and access points. DD-WRT is one of a handful of third-party firmware projects designed to replace manufacturer's original firmware with custom firmware offering additional features or functionality. A full list of the currently supported models can be checked here.
A list of incompatible devices can be seen here.
If your device is being supported you will need to set up Dynamic DNS configuration with DD-WRT. More information on how you can do that you can find here.
If your device is not supported you can configure Dynamic DNS on your personal computer. Dynamic DNS can be used on all major operating systems such as Linux, macOS, and Windows. Detailed documentation regarding this matter can be seen below: