I think the best thing you can do is to learn these phrases as being attached to verbs. For example: "To keep in line with", "to be in line with" (for objects/nouns), "to stay in line with" and "to keep with". I can't (at least right now) think of other verbs that can be used.
So, for your examples:
"I'm in line with the tradition" = "I'm keeping with tradition" OR "It's in line with tradition" People aren't usually used with the "to be" form of "in line with tradition". You could say, though "My ideas are in line with tradition".
"I plan to deal with the case in keeping with best practice standards": Here, we would use a comma instead of the 'in'. For example "I plan to deal with the case, keeping in line with best practice" or "I plan to deal with the case, keeping with best practice" (though the second one sounds a bit odd to me). It is important to note that this works because you're talking about *how* you're going to deal with the case, in contrast to...
"I want to cook in keeping with the traditional cuisine of my country": Here I think you need more words to have it make sense - again, because you need to be referring to the "how" of the sentence. For example "I want to cook in a way which keeps in line with the traditional cuisine of my country". But really, why would you say that when you can just say "I want to cook my country's traditional cuisine"?
"He likes to be in keeping with his principles": This is just straight-up wrong. Mostly again because people can't be the subject of "to be" with these sentences. You could say "He likes to keep with his principles", however, without the "to be" conjugation.