I did some checking. I talked to two other people who have same hardware and software as I do (i.e. newer iMac, SSD, 10.13.3) and neither of them have an "On My Mac" in their contacts either. So my guess is that you have to create it by signing out of iCloud like you mentioned and as I remember you get asked if you want to save the contacts to your local machine... and I remember doing that on the MacAir a few months ago.
What I don't understand is why an "on my mac" is needed since the contacts that are listed as being in iCloud in Contacts are also resident on my local hard drive. If you booted up without wi-fi and had no access to the net, the Contacts are still there. True, if you add one or made a change they would 'take' (on that local machine) but would not sync to iCloud or other devices. You would not lose them. So maybe Apple has made some changes to the program such that an 'on my mac' is not needed unless you quit iCloud ... and I'm not even sure why it asks you to 'keep on this iMac' when you do. My guess is that it is a legacy process that Apple has simply not 'cleaned up.' I think many will agree that Apple's software is not nearly as polished as it used to be when they took two years between OS versions. I wish they would go back to that and give us software that did not require a large update every 30 to 60 days.