Commerce: How can I save a custom SKU from a plugin?
You should be able to do this the usual way of setting entry fields in a plugin I think:

        $product-&gt;setContentFromPost(array(
            'sku' =&gt; $sku,
        );
        craft()-&gt;commerce_products-&gt;saveProduct($product);


(Alternatively, you could listen to onBeforeSaveProduct -  https://craftcommerce.com/docs/events-reference#commerce_products.onbeforesaveproduct - and since the product will be saved after that anyway you could probably leave out the call to saveProduct in that case)

I don't think I've tried it with products but it certainly works with orders for much the same sort of thing.