As the creation of new contracts is a very gas-consuming operation, the Gnosis Safe contracts use a proxy pattern where a master copy of the contract is deployed once and all its copies are deployed as minimal proxy contracts pointing to the master copy contract. This means that we can track the creation of new contract-based accounts by indexing an event from the ProxyFactory contract.
There’s also a second subgraph we built for this project, so that we could also track creation of contract-based accounts using Argent. The repo for that is here: https://github.com/tasitlabs/argent-subgraph