IMO, the only legal way to use your PEC number is to get employment by a firm and physically work for it, so that you could get the works executed as per standard engineering practice.
According to my understanding, 'Selling your PEC number to a firm' means to indicate that you physically work for a firm, BUT ACTUALLY YOU DO NOT, and get paid for it. This action has following implications.
Firstly, it is constitutes a lie that you work for the firm (whereas you actually do not).
Secondly, by doing so, you indirectly certify (or the firm wrongly poses) that you are supervising the engineering works executed by the firm (although your are not) as required by PEC, and thus you are responsible for all wrong doings and defects in engineering works executed, for which your PEC number is being used.
And, none of the above , is legal.
Regards.