Original:
てんで is the short form of てんでんバラバラ or てんでんばらばら which is used like てんでんばらばらの or てんでんばらばらに meaning scattering or being scattered in all directions or here and there.
Edited:
I'm going to prove my original answer is correct and to eliminate the predominant misunderstanding regarding てんで.
Definition 1:
てんで
[副] (打消しの表現を伴わないで)非常に。とても。「この店の料理はてんでうまい」
[Adverb](without being accompanied by expression of the negation) very much
Definition 2:
てんでに
[副]《「てんでんに」の音変化》めいめいに。それぞれに。各自。「てんでに旗を振る」
[Adverb]《A euphonic change from てんでんに》 apiece, in each, separately, individually
To prove てんで in てんで勝手に has the meaning of definition 2 the following two problems have to be solved.
Problem 1: Is there any example or a tester that could clarify that the meaning of てんで in てんで勝手に is only definition 2 but not definition 1?
Problem 2: Why could に be omitted in てんでに in the use of てんで勝手に without losing the meaning of the definition 2?
As for problem 1, the collection of use examples of てんで勝手に introduced by broccoli forest could not become the tester, because the examples could be interpreted as making sense both in the definition 1 and 2 without any contradiction as is said by naruto.
Then, let's てんでん be a tester instead of てんで.
From definition 2, てんでん is equivalent to てんで, and てんでん is the omitted form of てんでんに, so the tester てんでん have to solve the problem 2 afterwards, which is the same condition as てんで.
てんでん has not any meaning of definition 1, so if you find actual use examples of it, てんでん in てんでん勝手に could solve the problem 1, which means that てんで in てんで勝手に solve the problem 1 at the same time.
If you search for it on the Internet, you could find many examples as:
価値観が違い、欲望のあり方が異なっている小集団に分かれて、てんでん勝手に消費行動をされると、...
人間なんかは、てんでん勝手に、死んでしまうなり、生きながらえてゆくなり、運に任せておいたらいいわね。
...みんながそれぞれに(てんでん勝手に?)いろんなやり方でそれは統一とかいうものでもなく...
...家族が家に居てやれるのでミナ柴は庭に放しています、てんでん勝手に涼しい所を見つけてくつろいでいます、
そこでもって、てんでん勝手に、えー、 時間を過ごすというふうになってるわけでございますが、...。
あれよあれよとするうちに菊やハーブがてんでん勝手に根や株を増やし、...
一人一人手元で画像を見る風景はまるで友達同士がせっかく集まってもてんでん勝手に自分のスマホをかまっていると同じ風景を連想します。
それ以外では、てんでん勝手にいろんな暦を考え出して使っていたようです。
I think I could let てんでん be a sufficient tester to solve the problem 1.
As for problem 2, I'm going to show you some of the synonyms of てんでに or てんでんに as:
それぞれに、めいめいに/めいめいで、勝手に、好きに、好き勝手に、自分勝手に、身勝手に、無秩序に、無節操に、無統制に、ばらばらに(バラバラに)、てんでんばらばらに(てんでんバラバラに)、まちまちに、散り散りに、個々に、思い思いに、各々{おのおの}で、各自で、各員で、めいめいで、ひとりひとりで、個人個人で、個々人で
If you look at the synonyms as a whole, they have に (で in some words) at the end of each word.
Here, I found a very interesting fact that if you combine the two of them to strengthen the meaning, the former word becomes the stem of the adverb by omitting に or で like:
それぞれ勝手に (それぞれに + 勝手に), めいめい勝手に (めいめいに + 勝手に), 好き勝手に(好きに + 勝手に), 勝手バラバラに (勝手に + バラバラに), 個々まちまちに (個々に + まちまちに), てんでんバラバラに (てんでんに + バラバラに), てんでバラバラに (てんでに + バラバラに), てんでん勝手に (てんでんに + 勝手に), てんで勝手に (てんでに + 勝手に)
This completes the proof.
My edited answer to the given question:
てんで is the euphonic change from てんでんに whose meaning is apiece, in each, separately, individually, etc.
てんで in てんで勝手に in the given sentence is placed to strengthen the meaning of an adverb 勝手に that means selfishly or willfully. てんで勝手に is a combined adverb with てんでに and 勝手に. When making the combination, に is omitted in てんでに by leaving the stem of the word; the omission often happens in making this kind of combined words.