There isn't one maya command that does that. You need to figure out the name of the shape under the transform and then figure out to which shadingEngine the shape is connected. Then you figure out which material is connected to either the surfaceShader or the miMaterialShader plug or one of the other plugs, it all depends.
The quick and dirty way of doing it would be
sel = maya.cmds.ls(selection=True)
shape = maya.cmds.listRelatives ( sel, shapes=True )
shadingEngine = maya.cmds.listConnections (shape, source=False, destination=True)
material = maya.cmds.listConnections (shadingEngine, source=True, destination=False)
attr = shadingEngine[0]+'.surfaceShader'
plug = maya.cmds.connectionInfo( attr, sourceFromDestination=True)