Spin-state transition and microscopic magnetic properties of LaCoO3