ENH add cumcount groupby method

closes #4646

Happy to make this faster, but I think this is a good convenience function as is.