Wave equations on graded groups and hypoelliptic Gevrey spaces