Herbert Spencer, Principles of Psychology