You need a tool like ps4pkg_viewer or orbis-pub-gen .
You can use the built-in hdiutil command to create an .iso file from a .pkg file. However, this method requires some extra steps: how to convert pkg to iso updated
If you prefer a specialized software approach, several tools simplify the process: You need a tool like ps4pkg_viewer or orbis-pub-gen
Here's how to use PkgConverter: