something like this perhaps: all you need to do is figure out if the shape node is connected to a skinCuster.
from maya import cmds as mc
shape = mc.listRelatives(s=True)
con = mc.listConnections(shape[0], type='skinCluster')
if (con):
mc.setAttr(".inheritsTransform", 0)