I would like to know How to extract robots localization from the icp or ndt algo, currently I'm using scan registration for this reason
The transformation T itself contains the location and orientation of your robot. Try to search for some related information regarding SE3 pose representation.
Keywords: SE3, SO3, Rigid Body Kinematics, Matrix pose representation, coordinate transform
Some related materials: https://www.seas.upenn.edu/~meam620/slides/kinematicsI.pdf
Important: don't try to understand lie algebra.
T is composed of rotation and translation. The rotation is 3x3 matrix that is starting from left-top of your T. Each column of the rotation matrix is the x,y,z axis direction of the robot. And the translation which start from the left-most column of your T is just xyz location of your robot with respect to the world coordinate.
Direction is important. You need to find out if your T is world to robot or robot to world.