Trajectory-constrained optimal local time-continuous waveform controls for state transitions in $N$-level quantum systems