HTML5 custom data attributes in Drupal
If you mean how to add the data- attribute to the &lt;form&gt; tag it would be as easy as this:

$form['#attributes']['data-foo'] = 'bar';


The same goes for any element within the form:

$form['foo']['#attributes']['data-bar'] = 'baz';


For more info have a look at the documentation for #attributes.