Is there any way to preserve those backups, or should I just reformat the drive and start fresh?
Sorry but no.. Time Machine uses a different backup method (to Sparsebundle) over network.. whereas to local disk it creates a backup more directly.. We used to be able to fudge things.. but fudging is over. Especially on Big Sur which is more Surly than Big!!
Of course there is no need to reformat your existing USB drive.. just go out and buy a new one.. they are CHEAP as CHIPS (potato not silicon ones). Just buy a more standard sealed type USB for the job.. over network speed will not be as fast as USB3 locally.
should I format it in APFS
No.. stick to HFS+. What will happen is the Mac backing up will create an APFS container in the sparsebundle.. so you can leave it to software.
and should I make separate partitions or containers or folders to back each up to.
No.. just as the old Time Machine backup to Time Capsule worked with a single partition.. Time Machine will keep each computer separate by using Sparsebundles.. this is a virtual disk and amounts to the same thing as partitions.
Otherwise you need to setup 3 separate shares on the Mac to handle the 3 partitions you create.. that is certainly doable.. but I would just keep things as simple as possible.
Will everything continue to backup as long as the iMac is turned on, even if it's asleep overnight?
Now this is NOT a question that I can easily answer. I 100% trust experimental science over theory.. and I have not tried it so I am guessing..
In previous Mac OS versions.. backup during sleep was a major cause of corruption. I will need to hunt for the Apple statements which are few and far between when it says something doesn't work. But there is experience to say it was better NOT to try. This is the computer source not target.. but IMHO stick to a system of learning the bugs before you commit.
ie that is why you should buy a new USB drive.. and keep doing the backups directly for a few weeks.. even if you only do it once a week as long as you have some backup for your current files happening like iCloud. Or use a more reliable backup software like Carbon Copy Cloner to backup just your user files.
I note using a desktop Computer as target to run Time Machine was introduced at High Sierra.. although there were plenty of more dubious attempts beforehand. The old server additions did allow Time Machine to work.. on a Mac setup as Server.. which Apple also killed off.. so the extensions were added to the ordinary Mac OS. Since Apple knew the Time Capsule was headed for demise.. they had at least something to offer in its place.
BUTT.. Big FATT UGLY BUTT.. it was not hugely successful. There are a number of people who tried and reported it failed after x days.. In my testing it was terrible. Now word is that Big Sur fixed a lot of those bugs.. so it is worth a go.. but I would not trust it until it proves trustworthy.
Let me also add.. Carbon Copy Cloner is far more reliable and keeps decent logs. I have no pecuniary interest but have used it a long time to overcome the typical Time Machine warning.. I just shat in my nest so I am going to wipe out everything and start over.
That was happening 2-6 times a year depending on the setup in Network backups.. even to a Time Capsule.
CCC is much more reliable.. the one license covers multiple computers in your home and you can create separate folders and store a Sparsebundle for each Mac.. which is much more flexible than TM. It is free to download and use for a month.. so worth giving it a try.