There is no restriction to transfer shares from Pvt Ltd company to a foreign company. The foreign company must ascertain that the investment in your company is allowed under automatic route and is not in an area where prior FIPB (Foreign Investment Promotion Board) clearance is required. If FIPB clearance is required then they must first make a detailed application to FIPB for the same and only after receiving the clearance can they buy your shares. The whole process may take 8 to 12 weeks depending on the area, clarifications sought, etc. Meanwhile you should agree with the foreign company as to what is the valuation of your shares - this can be either by methods specified by the erstwhile CCI (controller of capital issues india) or it can be mutually agreed. Normally a CA's report is needed to show the basis of the valuation, if the agreed valuation is less than the actual valutation as per CCI norms then an explaination for the same should also be in the CA's report. Thereafter a share purchase agreement should be drawn up between you and the foreign company with the details of the transaction. After that just execute the agreement get your money and endorse the share certificates in the name of the foreign company. They will then approach your company to update the register of members.
Make sure that your current company does not restrict the transfer of shares without consent or it may have a first buy clause etc. It is good to do this transparently with knowledge of the current board and management to avoid hassles during the transfer.
No compliance or paperwork is required from your end once the shares are transfered. Your company will have to inform ROC and the foreign company will have to file the transation details with the RBI within 30 days of the transfer of money to you alongwith the FIRC (Foreign Inward Remittance Certificate). Other agencies, in case the clearance was through FIPB, may also need to be informed as specified in the letter of clearance from FIPB.
Make sure you ask for and keep copies of all the documents (Agreement, CA's valuation report, FIRC, FIPB letter, RBI filing, endorsed share certificate, etc).
Hope this helps. Cheers. Sandeep