ST_OverlapsCC
Clustering
ST_OverlapsCC (Python)
Assign a connected component id to each geometry based on the ST_Overlaps predicate.
Assign a connected component id to each geometry based on the ST_Overlaps predicate.
Two geometries are in the same component if they are connected through any chain
of geometries that overlap each other.
SQL reference:

