In principal - assuming you stay on the same mcpu=cortex-m4, you could create a couple of build configurations in CubeIDE to support this.
But. as @Osman SOYKURT points out. The ioc-file does not support MCU per build configuraiton. There is no concept of build targets or build configurations in the ioc-file. --> The same ioc-file will be shared by the F411xE and F446RE in the exactly same configuration.
I assume that this will constrain your development too much...
But, if you intend to use exactly the same ioc-file configuraiton for both F4 devices, then you could just manually add a second startup file and linker script and point them out to be used per build configuration and exclude them from build in the other configuration.
In practice I think most projects are composed of:
- The "user application"
- User developed code/libraries re-used between projects/devices
- MX generated device specific code
If you project looks like this, then I would opt for CDT projects which support setting totally different MCU per build configuration. One build config can target M4, another M0... These CDT project would be empty containers. And then you link in the folders/files you need from the above three bullets.
A bit more cumbersome to setup. But you get more flexibility and maintainability.