There are several oxides of nitrogen, hence the name NOx. NOx is caused by combustion temps over 2000 F where the normally stable N2 combines with the O2. Anything that causes high combustion temps will generate NOx. Cooling system problems, timing, a slightly lean mixture, ect. NOx generation is near maximum at a stoch mitxure so anything leaner will cause it to go up in even a healthy engine.
As jdub pointed out the egr system's sole purpose is to reduce NOx. It's further lowered by the reduction bed in your 3 way cat. It'd help if you posted the emissions report numbers and at what point on the ASM test the car failed.