API: preserve freq in DTI/TDI.factorize
cc @simonjayhawkins 
closes #35563 

this is an old branch I resurrected and rebased, so has some excess cruft that would need to be removed if we want to move forward.

LMK if there are any tests you'd like to see added based on the other issue (or just go ahead and push them if you like)
thanks @jbrockmendel I'll look in detail tomorrow and add tests as required. this is going to be hard to backport > if you can get this passing on the backport as well ok to merge, but pls put up a separate patch for that to see if its even possible.

sure > this is going to be hard to backport

maybe doable, in https://github.com/pandas-dev/pandas/pull/38137, the ci has not completed yet but looks like tests are passing (except for np-dev which is unrelated and failing on other PRs) yeah ok with just making this work here, can fixup later / cleanup @jreback it would be good to get this into master before 1.2.0rc0 if it's ready. not critical but would only need one backport. backporting to 1.1.5 does not block 1.2.0rc0

if more discussion needed, fine. no need to be under any pressure to merge. @simonjayhawkins no i think this is fine. I am sure that @jbrockmendel will have a cleanup on top of this, but good for now. thanks. Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
$ git checkout 1.1.x
$ git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
$ git cherry-pick -m1 c29c17630d73b834adcfa97837db01f43ff06ce8
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
$ git commit -am 'Backport PR #38120: API: preserve freq in DTI/TDI.factorize'
```

4. Push to a named branch :

```
git push YOURFORK 1.1.x:auto-backport-of-pr-38120-on-1.1.x
```

5. Create a PR against branch 1.1.x, I would have named this PR:

> "Backport PR #38120 on branch 1.1.x"

And apply the correct labels and milestones.

Congratulation you did some good work ! Hopefully your backport PR will be tested by the continuous integration and merged soon!

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                