Googling brought up this on the third hit. The first answer in that thread explains the error message.
Your code:
class TransformComponent : BaseComponent
...has 'TransformComponent' inherit 'BaseComponent', but didn't specify whether to inherit it publicly or privately. Private is default.
So 'TransformComponent' privately inherits 'BaseComponent', and since it privately inherits it, you can't convert the pointers.
The fix is to publicly inherit it:
class TransformComponent : public BaseComponent