Exposed form don't have class attribute
I guess hook_form_alter is not the right place to set attributes. But I may be wrong. What surely works is to set attributes in a preprocess function.

The following snippet adds the form ID as CSS class to every form. You could easily wrap some if-request around this to only fire on certain forms checking for $variables['element']['#form_id'].

/**
 * Implements hook_preprocess_HOOK().
 */
function MYTHEME_preprocess_form(&amp;$variables) {

  // Add form ID as class to form attributes.
  $variables['attributes']['class'][] = 'form';
  $variables['attributes']['class'][] = 'form-' . str_replace('_', '-', $variables['element']['#form_id']);
}