Do you still have the old iMac?
Then open your user home folder. In the sidebar the home folder is marked by a cute little house. Inside the Home folder you will find the Pictures folder. the Pictures folder may have a different name on your Mac, if the system language is not English.
Inside the Pictures folder look for an item with the filename exten .photoslibrary or an icon like a stack of several photos showing the rainbow colored flower.
Or use the Photos.app to find the library. when you laugh photos on the old Mac, open the Photos Preferences. At the top of the "General" photos preferences is a button to reveal the library in the Finder. Transfer this item to your new Mac.
If you have been using iCloud Photos and your photos are still in iCloud you can download them directly from iCloud.