you can examine the layer's properties to see if pyramids exist (right-click on the layer)
Auxiliary files—ArcGIS Pro | Documentation
auxilary files (rrd, ovr) can be found using Windows file explorer in the path where the raster resides... if they exist
Oh.....
I mean by python, arcpy or gdal or other libraries, actually, there are thousands of raster datasets.....
Batch Build Pyramids (Data Management)—ArcGIS Pro | Documentation is all that is in arcpy. gdal has similar functionality
This may not be what you are looking for, but one way to get information on a hosted map service's tiles is using the REST apis - specifically this one.
If you look at the response JSON's "lodInfos" section you can see which sets of tiles have been built. I've never worked with .rrd or .ovr files.
Maybe there is a way to do this via a python API, but I'm not sure.