On information captured by neural networks: connections with memorization and generalization