Discuss: transformation vs. aggregation in `agg` vs. `transform`
There have been multiple issues regarding
- Confusion about relative respective roles of `agg` and `transform` (and `apply`).
https://github.com/pandas-dev/pandas/issues/26960, https://github.com/pandas-dev/pandas/issues/18103 in both the DataFrame and Grou
- `transform('rank')` and others returning the wrong answer (first issue from 2016): https://github.com/pandas-dev/pandas/issues/14274, https://github.com/pandas-dev/pandas/issues/19354, https://github.com/pandas-dev/pandas/issues/22509, 

I'd like to prepare a PR to fix this, but I need to know what the consensus is first.

## 1. should `Groupby/DataFrame/Series.agg` disallow transformations?
 
https://github.com/pandas-dev/pandas/issues/14741#issuecomment-262953242 about `Groupby.agg`
```
you need to use .transform. .agg is by definition a reducer.
```
`agg` currently accepts transformations as well.

`DataFrame.agg` was merged in #27389 despite repeated objections to mixing transformations and aggregations, https://github.com/pandas-dev/pandas/pull/14668#issuecomment-260893757 and https://github.com/pandas-dev/pandas/pull/14668#issuecomment-269468649.

## 2. What should `transform('rank')` return?

**updated**

```
g.min               # one value per group. ok.
g.transform('min')  # one value per group, broadcasted. ok.
g.rank()            # like-index result. Ok
g.transform('rank') # Currently, a nonsense result.
```
 
 
On the one hand, users have been told that transformations don't belong in `transform` (!):  https://github.com/pandas-dev/pandas/issues/22509#issuecomment-501937245, https://github.com/pandas-dev/pandas/issues/14274#issuecomment-248760874. This makes sense if you think of the `transform('name')` form as solely for broadcasting aggregations.

On the other hand, the documentation for `transform`, as well as  Wes Mckinney's excellent pandas book portray `transform` as the dedicated tool for shape-preserving operations, so excluding them from the `transform('name')` case would be a little surprising.

Personally, I'm +0 for deprecating `transform('rank')` and with a warning to use `g.rank()`, as well as for the other transformation ops.