Selective Restoration:If you still have access to your old iMac, you might consider using your Time Machine backup to selectively restore only the most important or recent photos and videos. You can manually copy these files to an external drive or a cloud storage service and then import them into the new Mac's Photos app.
Do this and you lose your edit history, and need to choose between the originator edited versions. There is a serious risk of dataloss here.
External Storage: If your new Mac has Thunderbolt or USB-C ports, you can connect an external SSD or hard drive to store your photo library. You can then point the Photos app to this external drive as the location for your photo library. This allows you to access your photos and videos without consuming internal SSD space.
Every new Mac has these ports. But you (or ChatGPT XYZ or whatever it is) neglect to point out the most obvious: the extant drive needs to be formatted Mac OS X Extended, Journaled or apfs.
iCloud Photos: Consider using iCloud Photos to store your library in the cloud. This way, your entire library doesn't need to be stored locally. You can set up iCloud Photos on both your old iMac and new Mac, and access your photos and videos from any device while keeping the full library in the cloud.
The problem with this is that you can't do that without first restoring your Library from Time Machine, and you still don't have enough space for that.
Network-Attached Storage (NAS): If you have a network-attached storage device with sufficient space, you can use it to host your photo library. This way, you can access your photos over the network without taking up space on your Mac's internal drive.
You cannot run an iPhoto or Photos library from a NAS. You risk silent corruption of the Library and Dataloss.
External Storage for Archives: You can create archive folders on an external drive, organize your photos into these folders, and then store them on the external drive. While they might not be as seamlessly integrated as using the Photos app, you can still access your archived photos when needed.
Might not? Will not. Also, again as with selective restoration, you're forced to dump one version of another of the photographs, hence dataloss.
Clean Up and Optimize: Consider going through your photo library to remove duplicates, low-quality images, or videos you no longer need. This can help you free up some space and make the migration process more manageable.
And again, how do you do this without first restoring the Library, which you have no space to do?
The option is to format an external disk to Mac OS X Extended, Journaled or apfs. Restore the library to there, and then decide what you want to do.
When deciding on the best approach, consider your storage needs, budget, and how you want to access and manage your photos. Each option has its own advantages and limitations, so choose the one that aligns best with your preferences and requirements.
When offering advice that risks dataloss you need to warn people.