Boomers, Gen Xers, millennials and Gen Zers are taking varying approaches to investing. Here's what they're doing and key lessons you can learn from them.