YUM/DNF has bootstrap-in-chroot functionality built-in.
Just set up your disk layout the way you want on a disk device or a loopback disk backed by an image, and do something like:
$ sudo dnf --installroot=/path/to/mounted/target group install @core @hardware-support
And you're good to go. You can see the list of groups available to include by using "dnf group list --ids".