With stay bonuses funded out of the purchase price, agreed before employees are told, and paid on a schedule that runs past closing. Buyers expect this and frequently require it.
More detail
The people who most affect value, a plant manager, a lead programmer, an estimator, the engineer who holds the process knowledge, are also the people most able to leave during uncertainty. The standard structure is a retention bonus agreed with the seller and funded from proceeds, paid in tranches at closing and at six or twelve months after. Timing of disclosure is the harder question: tell people too early and you risk the information spreading, tell them too late and they feel handled. Most sellers inform a very small group under confidentiality agreement during diligence and inform the broader workforce at or immediately after closing, with the buyer present and a clear message about continuity.