Hi Niwantha,
When we start an interrogative sentence with question words such as "How", "What", "Who" and so on, the auxiliary verb (e.g. is, has) comes before the subject.
Example: How can (aux verb) I (subject) transfer this knowledge to him?
This inversion of the positions of auxiliary verb and subject is known as Grammar Inversion.
Just as a side discussion:
If your question is an embedded question (meaning that your question is found within a main clause), then inversion is not necessary.
Example: I will think [of] how I (subject) can (aux verb) transfer this knowledge to him.
*The question is embedded within the "I will...." main clause.
Therefore, your second sentence is correct. I added "of" for you because we "think of" something. The use of "could" will result in a greater degree of formality and politeness as compared to "can".
(Reference URL:
https://learnenglish.britishcouncil.org/en/english-grammar/can-or-could
Look under "Permission".)
Lastly, do take note that your first sentence is a direct question and should end with a question mark (?). However, your second sentence is an embedded questions and ends with a full stop (.)
I hope this helps.