We calculate the entanglement of the ground state of alkaline-earth-metal fermionic atoms confined in onedimensional optical lattices. This system can be described using the Kondo lattice model plus a harmonic confining potential, and we adopt the density-matrix renormalization group to study its ground state. We find that the local von Neumann entropy is constant in the insulating domains, and a one-to-one correspondence with the variance of the local density is observed. We show that the average entropy and its derivative are useful tools for identifying quantum transitions in impurity systems.