Created this for myself and thought I would share. It should match all devices which will be unsupported by macOS Sonoma upon release. The benefit of matching unsupported instead of the other way around is that it should not need updated when new devices come out. If you need a smart group for supported devices instead then simply swap the operator to "does not match regex."
To use, create a smart group named something like "macOS 14 Sonoma Unsupported Devices" with the following criteria:
Model Identifier matches regex ^(iMac[1-9],\\d|iMac1[0-8],\\d|Macmini[1-7],\\d|MacPro[1-6],\\d|MacBook([1-9]|10),\\d|MacBookAir[1-7],\\d|MacBookPro[1-9],\\d|MacBookPro1[0-4],\\d)$