How does the nitrogen generation system in a Boeing 777 work?
The 777 system

As RAC points out, "nitrogen-generation system" is somewhat of a misnomer. All the system does is remove oxygen from the ambient air and blow the rest into the center fuel tank; there is no chemically "new" nitrogen created. The 777 architecture is basically the same as the schematic that mike provides; in fact, all bleed-air aircraft use pretty much the same system. For example, here is an Airbus schematic:



Parker has a breakdown of the major components. Summarizing it and filling in some gaps, we have:


Ozone (O3) converter: Basically a catalytic converter that converts triatomic oxygen (ozone) to biatomic ("regular") oxygen to protect other elements in the system from oxidation.
Heat exchanger: Cools the bleed air (which is really hot when it comes off the engine), again to protect other elements of the system and increase their effectiveness.
Air separation module: Physically removes almost everything but the dinitrogen (N2) in the air. This separation is accomplished by running the air through semipermeable fibrous tubes; because almost all the non-N2 molecules present are smaller than the N2 molecules, those smaller molecules pass through the membranes and are exhausted overboard, leaving only the nitrogen to exit into the fuel tank.
Other: There are various filters to protect components from particulate matter, valves to control the timing and rate of flows, controllers to control the valves, and sensors to inform the controllers.


The 787 system

The 787 is a no-bleed airplane, which means that instead there is an electric-driven compressor to supply the NGS rather than bleed air. This setup requires a slightly different heat-exchanging architecture, but the overall function and operation of the primary system components are similar.