Quantifying resolution in cosmological N-body simulations using self-similarity