Problem preparing '08 iMac for resale
You should install the latest compatible Mac OS release available for your iMac.

It is correct that you need an Apple ID to download a version of Mac OS using Internet Recovery.

The installation of Mac OS, however, will not be linked to your Apple ID if you just run the setup.

As soon as the new owner starts the machine and creates a user account Mac OS will ask him/her to create a new Apple ID or to use an existing one.

Please let me know if this helps.