Can I use hook_css_alter inside of hook_form_alter
You can't use a hook function inside of a hook function. If you are in the css alter hook you have to get the information you need from where you are in code. For example you could check for the route name of the form because the current route match is available in a service. So this could work (not tested):

function mymodule_css_alter(&amp;$css) {
  $user = \Drupal::currentUser()-&gt;getRoles();
  $route = \Drupal::service('current_route_match')-&gt;getRouteName();
  if (in_array('administrator', $user) &amp;&amp; $route == 'entity.node.edit_form') {
    ...