(CG)NAT doesn't actually mean you all have the same IP address. It means you have internal addresses which are translated to a shared address, just like NAT at home only translates private '192.168.x.x' addresses into the shared public one – but it doesn't literally assign the same IP address to every device.
So that means the carrier can just look at the traffic before it hits the CGNAT routers, at which point every customer still has an individual 'private' IP address. (Similarly, if you used a packet capture tool (tcpdump) on your home router, you would see the original 192.168.x addresses on the 'lan' interface.) The carrier can also retrieve the currently active mapping table from their own routers (showing who's currently behind which public IP:port combination) if they need to.
And most likely, the carrier can also get statistics from the lower layer. For example, on Wi-Fi networks, the access point can count the actual Wi-Fi data frames and keep statistics by MAC address – without worrying about IP addresses, and indeed without checking whether the frames even contain IP at all. Although mobile networks are of course very different from Wi-Fi, I'd still generally assume that they nevertheless have some similar concept that can be tied to an individual device and measure its data usage "underneath" IP.