How can I alter the form to add a new validation handler?
The form ID for an entity is a string that is usually returned from EntityForm::getFormId(), if the class used for the form doesn't override that method.
This means that, by default, the form ID follows the &lt;entity&gt;_&lt;bundle&gt;_&lt;operation&gt;_form schema, where the &lt;operation&gt; part is omitted, when operation is default.
Since the Media module doesn't have a class that overrides EntityForm::getFormId(), the correct ID for the form that creates a new Media entity whose bundle is permissions_json is media_permissions_json_add. This means that a module whose machine name is gp_mcs can alter that form by implementing hook_form_FORM_ID_alter() with a function named gp_mcs_form_media_permissions_json_add_alter. (Note that the form ID is between form and alter.)