No, you cannot
Even if it isnt a teleportation effect, you need line of sight to the target location. So, even if we assume that both ships are in front of each other and have transparent cockpits (which they dont have to be), your path is still blocked by a barrier:
Any barrier that would block, reflect, or scatter light prevents you from moving through it.
Yes, you may argue that some light does get pass through glass, that's why you can see through it. But technically, not all light passes through, some is reflected, and some is scattered. That is why laser weapons will damage glass when shooting through them:
Laser weapons emit highly Focused beams of light that deal fire damage. These beams can pass through glass and other transparent physical barriers, dealing damage to such barriers as they pass through.
You can see glass. Light interacts with it, lasers can damage, deform, melt or cut it. And the solarian transports himself to the target location by turning into light, moving at lightspeed and turning that light back into his original form. So, this means that when light attempts to pass through glass, some energy is lost in the process, and would you be happy if you travelled and lost a leg on the cockpit? Me neither.
So, as GM, I wouldnt allow a solarian to lightspeed-travel to another starship's cockpit, even if he could see it.
The space is vast
Starship combat is left specifically vague, but considering the size of Colossal starships (Over 15,000 ft.), and that two colossal starships could occupy the same hex at the same time for a short time (Flyby stunt), we could safely assume that each hex is at least over 30,000 ft in length. This means that the only time your sight would allow you to actually see the other ship would be when they are occupying the same hex or you have some ability to increase your sight beyond normal vision.
And that's why, I said earlier, that ships rarely have transparent cockpits in starfinder, what you see is actually being translated by cameras and sensors. So, unless you are looking at another docked spaceship inside a spaceport, I find it highly improbable that you can see your destination using naked eye.
Starships have shields
The Shields used to protect a starship from attacks are made to protect them for all sorts of weapons, including lasers:
While almost every ship has simple navigational shielding to
prevent damage from tiny bits of debris, this protection does
little to stop a starship from being damaged by lasers, missiles,
and larger impacts. To defend against such threats, a ship has
energy shields. Projectors mounted around the ship create a
barrier that absorbs damage from attacks.
So, its safe to say that Deflecting Shields are enough to protect against a solarian-turned-into-light coming through your cockpit.