Femtosecond transient-grating techniques: Population and coherence dynamics involving ground and excited states