Japanese is honestly far more simple than English when it comes to aspect.
In Japanese, the rule is that 「〜いる」 means you are currently (or will be) in some state related to the verb, while 「〜いた」 means you had been in some state related to the verb.
There are many such states:
- The state of doing something (progressive).
- The state of regularly doing something (habitual).
- The state of having done something (perfect).
- The state of having the experience of having done something (experiential).
For example, 「勉強している」 can mean
- "I am studying." (progressive)
- "I study." (habitual)
- "I have studied." (perfect)
- "I have the experience of studying." (experiential)
(Note that the last two readings are definitely not common and need context to be forced, but they are possible. Even the habitual reading is not the first thing that comes to mind without context. The future reading is also possible for each of these.)
Correspondingly, 「勉強していた」 can mean
- "I was studying." (past progressive)
- "I used to study." (past habitual)
- "I had studied." (past perfect)
Which lines up perfectly, with the exception of the experiential reading disappearing because having the experience of doing something is permanent – you can't lose it.
"Have been" in English
You may have noticed I didn't list "I have been ...". The "have been" form in English is called the "perfect progressive", and is a bit of a weird form.
- The progressive in English requires that the action is going on at the current point in time.
- The past progressive in English requires that the action had been going on at some past point in time. It suggests that it is not going on now, but that can be canceled.
- The perfect progressive in English requires that the action has been going on until now or just recently, and focuses on the duration.
With enough context, you can line some of the meanings up exactly:
"Lately, I am studying Japanese."
"Lately, I have been studying Japanese."
Adding "Lately" to the progressive results in it having the meaning "both now and up to now", which is nearly identical to the perfect progressive.
"Have been" in Japanese
As I said, Japanese is fairly simple in that it only has two forms. That means you can't get the fine distinction you're looking for just by picking one form or the other. Instead, what you need to do is the equivalent of adding "Lately":
"Lately, I am studying Japanese." ⇒ "Lately, I have been studying Japanese"
I would say that 「日本語を勉強していた。」 does not have the meaning you are looking for, and I'm not sure where you heard that.
?? "Lately, I was studying Japanese."
?? "Lately, I used to study Japanese."
?? "Lately, I had studied Japanese."
As in English, it is hard to imagine where you'd say something like that. Another way to explain it: it is hard to have formerly been in a state lately.
As a side note, another thing that the perfect progressive "have been" does in English is allows you to specify how long you've been doing something: "I have been studying for 2 hours.". In Japanese, the 「〜いる」 form works just fine: 「二時間日本語を勉強している。」
Another note: the 「〜いた」 forms in Japanese have the same suggestion as the past forms in English: they suggest that you are no longer in that state. However, as in English, that suggestion can be canceled or irrelevant.
Aspect is Hard™, but hopefully this begins to help paint the connections between Japanese and English for you.