How to add attributes to forms?
You can use the addClass() method of the attribute class:

{%
  set classes = [
    'my-class-1',
    'my-class-2',
  ]
%}

&lt;input{{ attributes.addClass(classes) }}&gt;


You can either pass an array like the example above or pass a single class in the method directly: attributes.addClass('my-class'). 

For reference see the Drupal docs: https://www.drupal.org/docs/8/theming-drupal-8/using-attributes-in-templates