A rank $k$ generalized eigenvector $x$ for eigenvalue $\lambda_i$ satisfies $(A-\lambda_i I)^kx=0$ and $(A-\lambda_i I)^{k-1} x \ne 0$.
So, the rank $k$ generalized eigenvectors consist of everything in the nullspace of $(A-\lambda_i I)^k$ that is not in the nullspace of $(A-\lambda_i I)^{k-1}$. But the latter nullspace is contained in the former.
So, $\rho_k$ is $\text{null}((A-\lambda_i I)^k) - \text{null}((A-\lambda_i I)^{k-1})$. Applying the rank-nullity theorem gives the expression in your post.
See the definition of a generalized eigenvector linked in the passage that you posted.
A rank $k$ generalized eigenvector $x$ for eigenvalue $\lambda_i$ satisfies $(A-\lambda_i I)^kx=0$ and $(A-\lambda_i I)^{k-1} x \ne 0$.
So, the rank $k$ generalized eigenvectors consist of everything in the nullspace of $(A-\lambda_i I)^k$ that is not in the nullspace of $(A-\lambda_i I)^{k-1}$. But the latter nullspace is contained in the former.
So, $\rho_k$ is $\text{null}((A-\lambda_i I)^k) - \text{null}((A-\lambda_i I)^{k-1})$. Applying the rank-nullity theorem gives the expression in your post.