Neural dynamics of developmental decision making and sexually dimorphic behaviors In C. elegans