electricity generator definition