How do I get the associated node from a webform entity?
After some digging, I've found out the answer.

This is how I get the webform submission, the webform object, and the associated node:

    function MY_MODULE_webform_submission_form_alter(array &amp;$form, FormStateInterface $form_state, $form_id) {

        $entity  = $form_state-&gt;getFormObject()-&gt;getEntity(); // webform submission
        $webform = $form_state-&gt;getFormObject()-&gt;getWebform(); // webform object
        $node    = $entity-&gt;getSourceEntity(); // associated node

        // (...)
    }