It depends on which structure the petition can best support. Analyse both before choosing, and if the transaction is imminent, filing on a structure about to change is usually the weaker option.
File against the structure that will still be true in a year
There are two defensible sequences. Filing before closing produces a petition based on a clean, existing chain, but if the transaction closes shortly afterwards an amended petition may be needed almost immediately, and a reviewer may ask why the pending sale was not disclosed. Filing after closing means waiting, but it produces a petition based on the structure that will actually exist during the assignment.
A third option, filing before closing while disclosing the pending transaction and its expected effect, is often the most credible, because it is accurate and it demonstrates that the company understands its obligations. Whichever is chosen, the transferee's qualifying year must sit inside the three years before filing, so a long delay has its own cost. Decide this with the transaction lawyer and the immigration adviser in the same conversation.