As described in the official documents at https://npp-user-manual.org/docs/config-files/ , Macros are stored in shortcuts.xml. That file is saved in the same folder as all the other Notepad++ configuration files (including your preferences, file history, etc).
In a normal installation, they go in %AppData%\Notepad++\ In a normal installation with Settings > Preferences > Cloud enabled, they go in the DropBox/OneDrive/etc folder listed in that setting In a portable copy, they go in the same folder as notepad++.exeSo, if you copied one or more of those folders onto the new computer, then that’s how.