Dynamics of the minimally frustrated helices determine the hierarchical folding of small helical proteins