Grammar of words with exactly $k$ prefixes in another grammar
Unfortunately there is no such construction, as the context-free languages are not closed under this operation.

Consider the language $\{ a^nb^n \mid n\ge 1\} \cup \{ a^kb^nc^n \mid k,n\ge 1 \}$.

The language that has two prefixes in this language is $\{ a^nb^nc^n \mid n\ge 1\}\cdot \{a,b,c\}^*$, which is not context-free.