Enhancement of second harmonic generation in a layered MoS2 nanoresonator