US grocery retailer Kroger has reported higher second-quarter profit, helped by growth in customer traffic and average transaction size.