Following Martin Aspeli's tutorial, I tested your request and can confirm that oddly the klass-attribute cannot be applied on invisible widgets in the sub-fieldsets, returning a 'Key Error' in reference to the widget's name.
With other attributes, f.e. 'size', there is no problem.
Instead you can apply the class via Javascript.
If you want to provide a fallback in case the client hasn't Javascript enabled, you can add a condition in updateWidget(), checking if it is enabled and if not, apply the class with addClass() respectively the klass-attribute. Which will work then, because all fields are shown and not hidden anymore.