You can do it via various ways. The ways I did it before I moved to the Mac (and abandoned plans to transcode on the fly / keep two libraries automatically in sync) are:
j.River Media Center. I can sum it up as Foobar for non-nerds. It won't encode AAC's when transcoding on the fly, but it will launch multiple instances of LAME to transcode OTF. The OTF can be specified in the portable sync preferences. The current version will launch up to 4 instances of LAME. If you have a dual-core (or in my case, a quad-core) system then you can cut the transcode time. It didn't actually work as well as I thought it might but it was a heck of a lot faster than doing it on a single-core CPU.
The other option is Sveta, which is the portable loader companion to dbPoweramp, the favourite file transcoder of many people. This will transcode on the fly to a whole bunch of formats including AAC - and it's also (
AFAIK) currently the only piece of software to be able to transcode FLACs to Apple Lossless on the fly. I doubt it's useful for many, but Sveta also has other functions such as being able to rip songs directly to the iPod from CD without an intervening stage.