Cannot convert El Capitan .pkg file to installer application
I am trying to set up a bootable installer for a 2007 iMac, and to do so need to be able to store the El Capitan installer in my applications, as an application file. I am doing this on a 2020 MacBook Pro 13".
I have downloaded the dmg file from apple.com, and opened this to reveal a .pkg file. However, when I double click this in an effort to make it open and convert to an application file, I first get the message 'This package will run a program to determine if the software can be installed.' and then when I proceed, get the error message 'This version of OS X 10.11 cannot be installed on this computer.'
I assume this is because my MacBook thinks I want to install El Capitan onto it as an OS (which I don't), I just want to install the application file so I can use it to create the bootable installer on an external usb.
Is there any workaround so I can open this file and get the El Capitan installer? I've seen people asking the same question but no answers have been relevant so far. Thanks!